package org.ztr.yanai.blog.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: ZhaoTR
 * @Date: Created in 2025/11/22 14:30
 * @Description: 分页请求通用DTO
 * @Version: 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "分页请求参数")
public class PageRequestDTO {

    @Schema(description = "当前页码", example = "1")
    @Min(value = 1, message = "页码必须大于0")
    private Integer pageNum = 1;

    @Schema(description = "每页显示条数", example = "10")
    @Min(value = 1, message = "每页显示条数必须大于0")
    private Integer pageSize = 10;

    @Schema(description = "搜索关键字", example = "Spring")
    private String keyword;

    @Schema(description = "排序字段", example = "createdAt")
    private String sortField;

    @Schema(description = "排序方式：asc/desc", example = "desc")
    private String sortOrder = "desc";
}
